package com.xielaoban.redisTest;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import redis.clients.jedis.Jedis;

/**
 * @Author 蟹老板
 * @Date 2020/9/21 19:37
 * @Version 1.0
 * @Package com.xielaoban.redisTest
 * @Description
 */
public class redsiTest {
    private Jedis jedis;

    @Before
    public void beforeAll(){
        System.out.println("前置执行");
        jedis = new Jedis("localhost",6379);
    }


    @Test
    public void redsiTest1(){
        jedis.set("username","xielaoban");
        System.out.println(jedis.get("username"));
    }

    @After
    public void afterAll(){
        System.out.println("后置执行");
        jedis.close();
    }
}
